@charset 'UTF-8';

.file-preview__container {
    display: flex;
    flex-shrink: 0;
    flex-wrap: nowrap;
    height: 8rem;
    margin: 1px 0 5px;
    overflow-x: auto;
    overflow-y: hidden;
    overflow: auto;
    position: relative;
    white-space: nowrap;
    width: 100%;
}

.file-preview {
    @include clearfix;
    flex-shrink: 0;
    flex-wrap: nowrap;
    border: 1px solid $light-gray;
    display: inline-block;
    height: 100px;
    margin-right: 10px;
    position: relative;
    width: 120px;

    .spinner {
        height: 32px;
        left: 50%;
        margin-left: -16px;
        margin-top: -16px;
        position: absolute;
        top: 50%;
        width: 32px;
    }
}

.app__body {
    .file-preview__remove {
        border-radius: 4px;
        text-decoration: none;
        color: v(center-channel-color-56);
        position: absolute;
        right: 4px;
        text-align: center;
        top: 4px;
        width: 2.8rem;
        height: 2.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;

        &:focus {
            color: v(center-channel-color-56);
        }

        &:hover {
            background: v(center-channel-color-08);
            color: v(center-channel-color-72);
        }

        &:active {
            background: v(button-bg-08);
            color: v(button-bg);
        }
    }
}

.image-comment {
    background-position: left top;
    background-repeat: no-repeat;
    height: 300px;
    width: 300px;
}


.file-icon {
    height: 100%;
    width: 100%;

    &.text {
        @include file-icon('../images/icons/text.svg');
    }

    &.audio {
        @include file-icon('../images/icons/audio.svg');
    }

    &.video {
        @include file-icon('../images/icons/video.svg');
    }

    &.ppt {
        @include file-icon('../images/icons/ppt.svg');
    }

    &.generic {
        @include file-icon('../images/icons/generic.svg');
    }

    &.code {
        @include file-icon('../images/icons/code.svg');
    }

    &.excel {
        @include file-icon('../images/icons/excel.svg');
    }

    &.word {
        @include file-icon('../images/icons/word.svg');
    }

    &.pdf {
        @include file-icon('../images/icons/pdf.svg');
    }

    &.patch {
        @include file-icon('../images/icons/patch.svg');
    }

    &.image {
        @include file-icon('../images/icons/image.svg');
    }
}

.pdf-preview-spacer {
    height: 5px;
}

.pdf-max-pages {
    background: $white;
    bottom: 0;
    display: block;
    left: 0;
    position: relative;
    width: 100%;

    span {
        @include border-radius(3px);
        background: alpha-color($black, .8);
        bottom: 15px;
        color: $white;
        display: inline-block;
        height: 3em;
        line-height: 3em;
        padding: 0 1.5em;
        position: relative;
    }
}

.file-view--single {
    margin: 5px 0;
    position: relative;

    .file__image {
        @include legacy-pie-clearfix;

        .image-name {
            cursor: pointer;
            font-size: 12px;
            margin: -4px 0 0 0;
            color: v(center-channel-color-72);
            display: inline-block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;

            div {
                display: inline;
            }
        }

        .image-container {
            @include legacy-pie-clearfix;
            position: relative;
            max-width: 1024px;
            width: 100%;
            height: 100%;
        }

        .image-preload {
            position: absolute;
            z-index: 1;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            display: flex;
            justify-content: center;
            align-items: center;

            .fa {
                font-size: 20px;
                opacity: .6;
            }
        }

        .image-loaded {
            @include single-transition(all, .1s, linear);
            @include border-radius(4px);
            bottom: 0;
            min-height: 40px;
            min-width: 40px;
            max-height: 350px;
            max-width: 100%;

            .file-preview__button {
                display: block;
            }

            img {
                @include border-radius(4px);
                @include single-transition(all, .1s, linear);
                cursor: pointer;
                align-self: center;
                max-height: 350px;
                overflow: hidden;
                position: relative;
                z-index: 2;

                &.compact-display {
                    max-height: 175px;
                }

                &:hover {
                    @include box-shadow(0 2px 5px 0 rgba($black, 0.1), 0 2px 10px 0 rgba($black, 0.1));
                }

                &.min-preview {
                    max-height: 50px;
                    max-width: 100%;
                }

                &.min-preview--portrait {
                    max-height: inherit;
                    max-width: 50px;
                }

                &.small-image--inside-container {
                    box-shadow: none;
                    border-width: 0;
                    border-radius: 0;
                    width: unset;
                    margin: 0;
                    max-height: inherit;
                }
            }

            &.svg {
                width: 100%;
                height: inherit;
                display: block;

                img {
                    height: inherit;

                    &:hover {
                        @include box-shadow(0 2px 5px 0 rgba($black, 0.1), 0 2px 10px 0 rgba($black, 0.1));
                    }
                }
            }

            >.file-preview__button {
                min-height: 40px;
                min-width: 40px;
                text-align: left;
            }
        }

        .image-fade-in {
            opacity: 1;
        }
    }

    .file-details__name {
        display: block;
        font-size: 14px;
        font-weight: bold;
    }

    .file-details__name:hover {
        cursor: pointer;
        text-decoration: underline;
    }
}

.post-image__columns {
    display: flex;
    flex-flow: wrap;
    position: relative;
}

.post-image__column {
    @include single-transition(box-shadow, .15s, ease);
    @include border-radius(4px);
    cursor: pointer;
    overflow: hidden;
    align-items: center;
    background: v(center-channel-bg);
    border: 1px solid v(center-channel-color-16);
    color: v(center-channel-color);
    display: flex;
    height: 6.4rem;
    margin: 4px 12px 4px 0;
    max-width: 100%;
    position: relative;
    width: 320px;

    &:hover {
        @include box-shadow($elevation-1);

        .post-image__download {
            opacity: 1;
        }
    }

    &--placeholder {
        visibility: hidden;
    }

    &.file-preview {
        cursor: auto;
        flex-shrink: 0;
        flex-wrap: nowrap;
        margin: 0 10px 0 0;

        .post-image__details {
            padding-right: 3.2rem;

            .post-image__name {
                white-space: normal;
            }
        }
    }
}

.post-image__load {
    background-position: center;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    height: 100%;
    width: 100%;
}

.post-image {
    @include background-size(cover);
    background-color: $white;
    background-repeat: no-repeat;
    overflow: hidden;
    position: relative;
    text-align: center;
    width: 4rem;
    height: 4rem;
    border-radius: 4px;

    &.small {
        background-position: center;
    }

    &.normal {
        background-position: top left;
    }

    .spinner {
        .file__loading {
            left: 50%;
            margin-left: -16px;
            margin-top: -16px;
            position: absolute;
            top: 50%;
        }
    }

    .file__loaded {
        max-width: initial;

        &.landscape,
        &.quadrat {
            height: 100px;
        }

        &.portrait {
            width: 120px;
        }
    }
}

.post-image__thumbnail {
    @include cursor(zoom-in);
    flex: none;
    height: 100%;
    width: 6.3rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image__details {
    align-items: center;
    display: flex;
    font-size: 12px;
    height: 100%;
    flex: 1;
    overflow: hidden;
    text-align: left;
    position: relative;

    .post-image__detail_wrapper {
        padding: 0;
        display: flex;
        flex: 1;

        .post--compact & {
            padding-left: 8px;
        }

        .post-image__detail {
            height: 100%;
            line-height: normal;
            width: 100%;

            .post-image__name {
                display: block;
                font-weight: 600;
                margin-bottom: 3px;
                outline: none;
                text-decoration: none;
                word-break: break-word;

                a {
                    border-radius: 100px;
                }
            }

            .post-image__type {
                @include opacity(.6);
            }

            .post-image__size {
                @include opacity(.6);
                margin-left: 4px;
            }
        }
    }

    .post-image__download {
        @include single-transition(opacity, .15s, ease);
        align-items: center;
        display: flex;
        height: 100%;
        justify-content: center;
        line-height: 0;
        padding: 0 1.6rem;
        right: 0;
        text-align: center;
        top: 0;
        opacity: 1;

        a {
            text-decoration: none;
            border-radius: 4px;
            font-size: 1.6rem;
            color: v(center-channel-color-56);
            width: 3.2rem;
            height: 3.2rem;
            display: flex;
            align-items: center;
            justify-content: center;

            &:focus {
                color: v(center-channel-color-56);
            }

            &:hover {
                background: v(center-channel-color-08);
                color: v(center-channel-color-72);
            }

            &:active {
                background: v(button-bg-08);
                color: v(button-bg);
            }
        }

        span {
            display: inline-block;
        }

        svg {
            @include opacity(.7);
            @include single-transition(all, .1s, linear);
            @include border-radius(50%);
            border: 1px solid;
            display: inline-block;
            height: 30px;
            width: 30px;

            &:hover {
                @include opacity(1);
            }
        }
    }

    .post-image__progressBar {
        margin-bottom: 0px;
        height: 7px;
        position: absolute;
        bottom: 0px;
        width: 100%;
        border-radius: 0px;
    }

    .progress-bar {
        background-color: rgb(40, 90, 185);
    }

    .post-image__uploadingTxt {
        color: v(center-channel-color-56);
    }
}

.file-details__container {
    @include display-flex;
    background: $white;

    .file-details {
        height: 270px;
        padding: 14px;
        text-align: left;
        vertical-align: top;
        width: 320px;

        .file-details__name {
            color: alpha-color($black, .9);
            font-size: 16px;
            margin: 5px 0;
            word-break: break-word;
        }

        .file-details__info {
            color: alpha-color($black, .5);
        }
    }

    .file-details__preview {
        border-right: 1px solid $light-gray;
        height: 270px;
        vertical-align: center;
        width: 320px;

        img {
            width: 80px;
        }

        // helper to center the image icon in the preview window
        .file-details__preview-helper {
            display: inline-block;
            height: 100%;
            vertical-align: middle;
        }
    }
}

.file-playback__controls {
    @include single-transition(opacity, .6s);
    bottom: 0;
    cursor: pointer;
    font-size: 22px;
    position: absolute;
    right: 5px;
    transition: opacity .6s;
    z-index: 2;

    &.stop {
        @include opacity(0);
    }
}

.view-image__loading {
    background: $black;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    flex-direction: column;
    padding-top: 28px;

    .fa {
        color: $white;
        font-size: 20px;
        opacity: .6;
    }
}

.image-loading__container {
    position: relative;
    max-height: inherit;
    overflow: hidden;
}

.file-preview__button {
    display: inline-block;
    vertical-align: top;
    max-height: inherit;
}

.small-image__container {
    margin: 5px 2px;
    background: var(--center-channel-bg);
    border: 1px solid var(--center-channel-color-32);
    @include border-radius(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    max-height: inherit;
    min-width: 48px;
    max-width: calc(100% - 5px);

    &:hover {
        @include single-transition(all, .1s, linear);
        @include box-shadow(0 2px 5px 0 rgba($black, 0.1), 0 2px 5px 0 rgba($black, 0.1));
        z-index: 2;
    }
}

.small-image__container--min-width {
    width: 48px;
}
